package com.skyline.jfs.storage.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.skyline.jfs.common.config.Config;
import com.skyline.jfs.storage.dao.JFSStorageDao;
import com.skyline.jfs.storage.mapper.JFSAbsoluteStorageMapper;
import com.skyline.jfs.storage.model.JFSAbsoluteStorage;
import com.skyline.jfs.storage.model.JFSStorage;

@Repository("jfsStorageDao")
public class JFSStorageDaoImpl implements JFSStorageDao {

	@Autowired
	private JdbcTemplate jdbcTemplate;

	@Override
	public void insertJFSStorage(Long fileId, Integer jfsNodeId,Long absFileId) {
		String sql = Config.getSql("JFSStorageDao.insertJFSStorage");
		jdbcTemplate.update(sql, fileId, jfsNodeId,absFileId);
	}

	@Override
	public List<JFSStorage> findJFSStorageByFileID(Long fileId) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<JFSStorage> findJFSStorageByJFSNodeId(Integer jfsNodeId) {
		// TODO Auto-generated method stub
		return null;
	}
	
	public List<JFSAbsoluteStorage> findJFSAbsoluteStorageByFileID(Long fileId){
		String sql=Config.getSql("JFSStorageDao.findJFSAbsoluteStorageByFileID");
		return jdbcTemplate.query(sql,JFSAbsoluteStorageMapper.getMapper() ,fileId);
	}

}
